


let EXPORTED_SYMBOLS = ["NotImplemented",
                        "NotSupportedInE10s",
                        "BadParameter",
                        "UnsupportedCommand",
                        "RuntimeError",
                        "MacroSyntaxError",
                        "StopSignal"];

function NotImplemented(msg) {
    this.message = msg+" has not been implemented yet";
    this.name = "NotImplemented";
}

NotImplemented.prototype = Object.create(Error.prototype);
NotImplemented.prototype.constructor = NotImplemented;

function NotSupportedInE10s(msg) {
    this.message = msg+" is not supported in multiprocess Firefox";
    this.name = "NotSupportedInE10s";
}

NotSupportedInE10s.prototype = Object.create(Error.prototype);
NotSupportedInE10s.prototype.constructor = NotSupportedInE10s;

function BadParameter(msg, num) {
    this.message = typeof(num) != "undefined" ? "expected "+msg+
        " as parameter "+num : msg;
    this.name = "BadParameter";
    this.errnum = -911;
}

BadParameter.prototype = Object.create(Error.prototype);
BadParameter.prototype.constructor = BadParameter;


function UnsupportedCommand(msg) {
    this.message = "command "+msg+
        " is not supported in the current version";
    this.name = "UnsupportedCommand";
    this.errnum = -912;
}

UnsupportedCommand.prototype = Object.create(Error.prototype);
UnsupportedCommand.prototype.constructor = UnsupportedCommand;


function RuntimeError(msg, num) {
    this.message = msg;
    if (typeof num != "undefined")
        this.errnum = num !=1 && num > 0? -1*num : num;
    this.name = "RuntimeError";
}

RuntimeError.prototype = Object.create(Error.prototype);
RuntimeError.prototype.constructor = RuntimeError;


function MacroSyntaxError(msg) {
    this.message = msg;
    this.name = "MacroSyntaxError";
    this.errnum = -910;
}    

MacroSyntaxError.prototype = Object.create(Error.prototype);
MacroSyntaxError.prototype.constructor = MacroSyntaxError;

function StopSignal() {
    this.message = "Stop macro replaying";
    this.name = "StopSignal";
}

StopSignal.prototype = Object.create(Error.prototype);
StopSignal.prototype.constructor = StopSignal;
